const Login = () => import("@/views/login");
const Home = () => import("@/views/home");
// home子路由
const TypeIn = () => import("@mview/typeIn");
const Change = () => import("@mview/change");
const Recycle = () => import("@mview/recycle");
const Search = () => import("@mview/search");
const System = () => import("@mview/system");
const SumUp = () => import("@mview/sumUp");

// 错误页
const Err404 = () => import("@/views/error/Err404");

const routes = [
	{
		path: "/", // 访问路径
		name: "login", // 路由名称
		component: Login, // 对应组件
	},
	{
		path: "/home",
		name: "home",
		component: Home,
		redirect: "/home/typein",
		children: [
			{
				path: "typein",
				name: "typein",
				component: TypeIn,
				meta: {
					auth: true,
				},
			},
			{
				path: "change",
				name: "change",
				component: Change,
				meta: {
					auth: true,
				},
			},
			{
				path: "recycle",
				name: "recycle",
				component: Recycle,
				meta: {
					auth: true,
				},
			},
			{
				path: "search",
				name: "search",
				component: Search,
				meta: {
					auth: true,
				},
			},
			{
				path: "system",
				name: "system",
				component: System,
				meta: {
					auth: true,
				},
			},
			{
				path: "sumup",
				name: "sumup",
				component: SumUp,
				meta: {
					auth: true,
				},
			},
		],
	},
	{
		path: "/Err404",
		name: "Err404",
		component: Err404,
	},
];

export default routes;
